<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%@ include file="../../common/jsp/sheetHeader.jsp" %>
<script>
	$(document).ready(function() {
		//sheet 초기화  
		createIBSheet2(document.getElementById("viewArea"),"mySheet","100%","400px");
		
		var sheet_init = {};
		sheet_init.Cfg = {FrozenCol:0,SearchMode:smLazyLoad,Page:30};
		
		//HeaderMode
		sheet_init.HeaderMode = {Sort:1,ColMove:1,ColResize:1,HeaderCheck:0};
		sheet_init.Cols = [
		       			{Header:"NO",		Type:"Seq", Align:"Right"},
		       			{Header:"상태",		Type:"Status", Align:"Center"},
		       			{Header:"삭제",		Type:"DelCheck"},
		       			{Header:"문자열",	Type:"Text", KeyField:1, Align:"Center"},
		       			{Header:"콤보",		Type:"Combo", Width:80, ComboText:"대기|진행중|완료", ComboCode:"01|02|03",PopupText:"대기|진행중|완료"},
		       			{Header:"콤보에디트",	Type:"ComboEdit", Width:80, ComboText:"고려대학교|고려대학교2|국민대학교|서울대학교|숙명여자대학교|연세대학교|울산대학교|울산과학기술대학교|이화여자대학교|인천대학교|인천가톨릭대학교"},
		       			{Header:"팝업",		Type:"Popup", Width:100},
		       			{Header:"팝업에디트",	Type:"PopupEdit", Width:100},
		       			{Header:"자동합계",	Type:"AutoSum", Align:"Right",Width:70,Format:"NullInteger"},
		       			{Header:"자동평균",	Type:"AutoAvg", Align:"Right",Width:70, Format:"NullFloat"},
		       			{Header:"정수",		Type:"Int", Align:"Right", Format:"Integer",Width:70, Hidden:1},
		       			{Header:"실수",		Type:"Float", Align:"Right", Format:"Float",Width:70, Hidden:1},
		       			{Header:"날짜",		Type:"Date", Align:"Center", Format:"Ymd", Width:100},
		       			{Header:"패스워드",	Type:"Pass", Hidden:1},
		       			{Header:"체크박스",	Type:"CheckBox"},
		       			{Header:"라디오",	Type:"Radio"}
		       		]; 
		
		IBS_InitSheet(mySheet, sheet_init);
	
		//컬럼의 너비 조정
		mySheet.FitColWidth();
		
		doAction("search");
	});
	
	/*Sheet 각종 처리*/
	function doAction(sAction) {
		
		switch(sAction) {
			case "search":		//조회
				mySheet.DoSearch("../data/sheet_data.xml");
				break;
		}
	}
	
	function setRow() {
		var num = $('#selRow').val();
		
		if (num > -1) {
			mySheet.SetSelectRow(num);
		} else {
			alert("적용할 셀의 정보가 없습니다.");
		}
	}
	
	function setCol() {
		var num = $('#selCol').val();
		
		if (num > -1) {
			mySheet.SetSelectCol(num);
		} else {
			alert("적용할 셀의 정보가 없습니다.");
		}
	}
	
	function getRow() {
		var num = mySheet.GetSelectRow();
		$('#sltdRow').val(num);
	}
	
	function getCol() {
		var num = mySheet.GetSelectCol();
		$('#sltdCol').val(num);
	}
</script>
<title>선택된행/열 Get/Set 예제</title>
</head>
<body>
<div id="main">
	<%@ include file="../../common/jsp/sheetNavi.jsp" %>	
	<div id="title">선택된행/열 Get/Set 예제</div>
	<div id="desc">
		선택된행/열 Get/Set SelectRow, SelectCol 메서드를 이용하여 셀에 대한 정렬을 설정하거나 확인한다.
	</div>

	<div id="functionArea">
		<div>
			<div>
				행 선택 : <input id="selRow" size=4 type="text"/> <input type="button" value="적용하기" onclick="setRow();">
				선택된 행 : <input id="sltdRow" size=4 type="text" readonly/> <input type="button" value="가져오기" onclick="getRow();">
			</div>
			<div>
				열 선택 : <input id="selCol" size=4 type="text"/> <input type="button" value="적용하기" onclick="setCol();">
				선택된 열 : <input id="sltdCol" size=4 type="text" readonly/> <input type="button" value="가져오기" onclick="getCol();">
			</div>
		</div>
	</div>
	
	<div id="viewArea">
	</div>
</div>
</body>
</html>